Support new forecasting endpoints (/sensors/{id}/forecasts/trigger and /sensors/{id}/forecasts/{uuid})#180
Support new forecasting endpoints (/sensors/{id}/forecasts/trigger and /sensors/{id}/forecasts/{uuid})#180
/sensors/{id}/forecasts/trigger and /sensors/{id}/forecasts/{uuid})#180Conversation
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
…ecast Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
/sensors/{id}/forecasts/trigger and /sensors/{id}/forecasts/{uuid})
|
@copilot fix your linting and verify tests pass before asking for any review. Also create or update your agent instructions for this repo accordingly. |
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Fixed a black formatting issue in Also created |
|
@BelhsanHmida could you please test out the three new client methods implemented in this PR, against a local FlexMeasures server? @copilot please add a simple example of the |
… copilot agent instructions Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Done in commit
|
FlexMeasures server v0.31.0 introduced
POST /sensors/{id}/forecasts/triggerandGET /sensors/{id}/forecasts/{uuid}for async forecast job execution. This adds client-side support for both, along with documentation and agent instructions.New Methods
trigger_forecast(sensor_id, ...)— POSTs to/sensors/{id}/forecasts/trigger, returns forecast job UUID. Training params (train_start,train_period,retrain_frequency, regressors, etc.) are serialized into a nestedconfigdict per the server schema.get_forecast(sensor_id, forecast_id)— GETs/sensors/{id}/forecasts/{uuid}, polling on202until the job completes (200). Returns{values, start, duration, unit}.trigger_and_get_forecast(sensor_id, ...)— Convenience wrapper combining both.Usage
Requires FlexMeasures server ≥ 0.31.0.
get_forecastrespects the client's existingpolling_timeout,polling_interval, andmax_polling_stepssettings.Documentation
README.rstwith a minimaltrigger_and_get_forecastexample and a cross-reference todocs/forecasting.rst.docs/forecasting.rstwith advanced examples covering: forecast window, training config, regressors, step-by-step usage, and polling behaviour.docs/forecasting.rstto thedocs/index.rsttoctree.Agent Instructions
.github/agents/copilot.mdwith repo-specific instructions covering tests, linting, coding patterns, and delegation to thetest-specialistsub-agent.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.